home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / grphvga.com / GRAPHVGA.DOC < prev    next >
Encoding:
Text File  |  1991-03-30  |  11.9 KB  |  304 lines

  1.                         GraphVGA Unit Revision 1.0
  2.                              Shareware Release
  3.  
  4. BGI and Borland Graphical Interface are registered trademarks of
  5. Borland International, Inc.
  6.  
  7. (c) Copyright 1991  Modern Solutions.  All rights reserved.
  8.  
  9. Modern Solutions  P.O. Box 55721, Hayward, California 94545
  10.  
  11. INTRODUCTION
  12. ************
  13.  
  14. SHAREWARE
  15. *********
  16.  
  17.     GraphVGA has been released under shareware concepts.  This enables users
  18. of Turbo Pascal to use GraphVGA within their software without any initial
  19. cost incurred.
  20.  
  21.     Shareware software is not considered free.  You are, however, encouraged
  22. to use this software as often as you like.  Once you are satisfied with the
  23. product and its capabilities, it is recommended that the program is registered.
  24. Registration entitles users to an official registered copy of the GraphVGA
  25. unit and the accompanying documentation.  Registered users also will be kept
  26. up to date on latest releases and updates and are entitled to using Modern
  27. Solutions's software support line.
  28.  
  29.     Once registered, the registered user is entitled to use GraphVGA as often
  30. as he or she likes within their programs, whether commerical or not, as long as
  31. it is not distributed as a 'stand alone' product.
  32.  
  33.     To register the GraphVGA unit, send a check or money order for $35.00 +
  34. $2.50 ( Shipping & Handling ) with the registration form. ( No C.O.D. please. )
  35.  
  36.     The registration form is included with the GraphVGA unit files.
  37. To print the registration form, run the REGISTER batch file from the DOS
  38. prompt. ( For more information on running batch files, see your DOS manual. )
  39.  
  40. DISCLAIMER
  41. **********
  42.  
  43.     Modern Solutions makes no warranties, neither expressed nor implied
  44. pertaining to this software.  If you choose to use this software, you do
  45. so at your own risk, and Modern Solutions is not obligated for any personal
  46. loss incurred by the usage of this software.
  47.  
  48.     Permission is hereby granted to distribute this software under shareware
  49. concepts as long as this documentation accompanies it.  This software may not
  50. be distributed for profit other than the single-disk asking price of a
  51. shareware distributor used to cover duplication and distribution costs, not to
  52. exceed $10 under any circumstances.  Modern Solutions reserves all rights to
  53. the software and accompanying documentation.
  54.  
  55. GRAPHVGA
  56. ********
  57.  
  58.     GraphVGA is a set of high performance graphic routines for EGA or VGA
  59. programmers that can be used to replace or supplement Borland's Graphical
  60. Interface.  GraphVGA was created to give programmers an alternative to calling
  61. BGI routines.
  62.  
  63. THE GRAPHVGA UNIT
  64. *****************
  65.  
  66. procedure SetVideoMode(number:byte);
  67.  
  68.         Sets the appropriate graphics video mode.  The following video modes
  69.         will work properly with the GraphVGA system :
  70.  
  71.                  Resolution       Adapter   SetVideoMode
  72.  
  73.                320 x 200 x 16     EGA/VGA      $0D
  74.                640 x 200 x 16     EGA/VGA      $0E
  75.                640 x 350 x 16     EGA/VGA      $10
  76.                640 x 480 x 16     VGA          $12
  77.  
  78. function GetVideoMode:integer;
  79.  
  80.         Gets the current video mode.  See SetVideoMode above.
  81.  
  82. function CharacterHeight:word;
  83.  
  84.         Returns the height of the current character matrix.
  85.  
  86.         By default DOS will setup the most appropriate font for the given
  87.         video mode.  This value will represent the number of pixels that
  88.         make up the height of each character.
  89.  
  90.         This value can be reprogrammed with the GraphVGA command ScreenFont.
  91.         See ScreenFont command below.
  92.  
  93. function EGApresent:boolean;
  94.  
  95.         Determines whether an EGA compatible adapter is available.
  96.  
  97. function EGAmemory:integer;
  98.  
  99.         Returns the amount of memory available on your EGA compatible adapter.
  100.  
  101. procedure FastLine(x1,y1,x2,y2,number:integer);
  102.  
  103.         Draws a FastLine from x1,y1 to x2,y2 with the color specified by number.
  104.  
  105. function FastGetPixel(x1,y1:integer):integer;
  106.  
  107.         Gets the color value of the pixel at location x1,y1.
  108.  
  109. procedure FastPutPixel(x1,y1,number:integer);
  110.  
  111.         Sets the color value of the pixel at x1,y1 to the color specified by
  112.         number.
  113.  
  114. procedure FastGetBlock(x1,y1,x2,y2:integer;storage:pointer);
  115.  
  116.         Copies a block of video memory from x1,y1 to x2,y2 to ram.  This
  117.         command is useful for block animation and other special effects.
  118.  
  119.         The variable storage must be a pointer to a variable that is large
  120.         enough to handle the block.  To determine the physical size of the
  121.         block use the following equation :
  122.  
  123.                 ByteSize=(INT((X2-X1)/8+1))*(Y2-Y1+1)*4+5
  124.  
  125. procedure FastPutBlock(x1,y1:integer;storage:pointer);
  126.  
  127.         Copies a block of memory pointed to by storage to the video screen
  128.         starting at position x1,y1.  This command is the complement to
  129.         FastGetBlock.  See FastGetBlock above.
  130.  
  131. procedure FastChar(c1:char;x1,y1,f1,b1:integer);
  132.  
  133.         Places a DOS compatible character on the video screen at the location
  134.         specified by x1,y1 and using the colors f1,b1 for foreground and
  135.         background.
  136.  
  137.         FastChar use the character set initialized by SetVideoMode or the
  138.         character set reinitialized by the GraphVGA command ScreenFont.
  139.  
  140. procedure FastMode(mode:integer);
  141.  
  142.         FastMode sets the drawing method of all of the GraphVGA routines.
  143.  
  144.         The method by which all graphics routines, including character
  145.         routines, write to video screen can be altered by the FastMode command.
  146.  
  147.         The possible options are as follows :
  148.  
  149.                 fastreplace
  150.                 fastand
  151.                 fastor
  152.                 fastxor
  153.  
  154.         The above are constants that are within the GraphVGA unit's interface
  155.         section.
  156.  
  157. procedure FastColor(number,value:integer);
  158.  
  159.         Redefines the basic color palette by changing the normal color
  160.         specified by number to the new color specified by value.
  161.  
  162. procedure FastCircle(xc,yc,major,minor,number:integer);
  163.  
  164.         Draws an ellipse with xc,yc as the centerpoint.  Major and minor
  165.         determine the radius of the X and Y axis.  Number specifies the color
  166.         to use when drawing the ellipse.
  167.  
  168. procedure ScreenStart(x1,y1:integer);
  169.  
  170.         ScreenStart redefines the origin of the screen within the video buffer.
  171.         All subsequent GraphVGA commands are relative to the value specified
  172.         with the ScreenStart command.
  173.  
  174.         ScreenStart is useful to produce a panning or smooth movement effect
  175.         with the video buffer.
  176.  
  177. procedure ScreenSize(x1,y1:integer);
  178.  
  179.         ScreenSize will redefine the physical boundaries of the video buffer.
  180.         This is usually used in conjunction with ScreenStart.
  181.  
  182.         All subsequent GraphVGA commands can treat the physical video buffer as
  183.         defined by ScreenSize.  For example :
  184.  
  185.            ScreenSize(1280,350);
  186.  
  187.                 Redefines the buffer to become twice as wide.  The video
  188.                 display will not change unless a ScreenStart command is issued.
  189.  
  190.            FastLine(0,0,1280,350);
  191.  
  192.                 Draws a line diagonally across the video buffer.
  193.  
  194.         To determine just how large your video buffer can be, compare the
  195.         value returned by the GraphVGA command EGAmemory with the following
  196.         equation :
  197.  
  198.                 ByteSize=((X2-X1+1)/8)*(Y2-Y1+1)*4
  199.  
  200.         If ByteSize is greater than EGAmemory, then you will need to reduce the
  201.         ScreenSize parameters.
  202.  
  203. procedure ScreenBorder(number:integer);
  204.  
  205.         Changes the border color of the video screen.
  206.  
  207. procedure ScreenFont(font:pointer;height:word);
  208.  
  209.         Redefines the DOS graphics character set.
  210.  
  211.         When the SetVideoMode command is issued, DOS automatically defines
  212.         the default font.  Once the SetVideoMode command is issued, you can
  213.         redefine this default font with the ScreenFont command.
  214.  
  215.         Font is a pointer to a valid DOS font replacement.  Height specifies
  216.         the number of pixels in the height of the new font.
  217.  
  218.         In order to produce a font the size of 80 by 25 characters DOS will
  219.         determine the Y resolution of the video buffer and then divide that
  220.         amount by 25.  This value is the value returned by the GraphVGA
  221.         routine CharacterHeight.  For example :
  222.  
  223.                 350 / 25 = 14   ( EGA 350 line mode )
  224.  
  225.         If the CharacterHeight of the 350 line mode was 8 then you would
  226.         create an 80 by 43 line mode.  You can accomplish this with the
  227.         following command :
  228.  
  229.                 ScreenFont(@Font8x8,8);
  230.  
  231.         Make sure you use the unit entitled 'VGAfonts' that is included with
  232.         the GraphVGA files.  This command will reprogram the video system to
  233.         create an 80 by 43 line mode that will work the GraphVGA command
  234.         FastChar.
  235.  
  236.         Likewise, this applies to VGA modes as well, like the 640 by 480 mode.
  237.         By using the same command as above, you will create a 80 by 60 character
  238.         mode.
  239.  
  240.         Remember, unlike DOS, you can use FastChar to write characters outside
  241.         of the visible video buffer.  This holds true for all GraphVGA routines.
  242.         It is a good practice to retrieve the video mode using GetVideoMode
  243.         before altering the DOS fonts and then SetVideoMode before terminating
  244.         your program.
  245.  
  246. function Joybutton(sticknumber,buttonnumber:integer):boolean;
  247.  
  248.         Returns the current state of the joystick button specified by the
  249.         value sticknumber and the button value buttonnumber.
  250.  
  251. procedure Joystick(sticknumber:integer;var x,y:integer);
  252.  
  253.         Returns the current location of the joystick specified by the value
  254.         sticknumber and places the result within the variables x and y.
  255.  
  256.  
  257.  
  258.          ----------------end-of-author's-documentation---------------
  259.  
  260.                          Software Library Information:
  261.  
  262.                     This disk copy provided as a service of
  263.  
  264.                            Public (software) Library
  265.  
  266.          We are not the authors of this program, nor are we associated
  267.          with the author in any way other than as a distributor of the
  268.          program in accordance with the author's terms of distribution.
  269.  
  270.          Please direct shareware payments and specific questions about
  271.          this program to the author of the program, whose name appears
  272.          elsewhere in  this documentation. If you have trouble getting
  273.          in touch with the author,  we will do whatever we can to help
  274.          you with your questions. All programs have been tested and do
  275.          run.  To report problems,  please use the form that is in the
  276.          file PROBLEM.DOC on many of our disks or in other written for-
  277.          mat with screen printouts, if possible.  PsL cannot debug pro-
  278.          programs over the telephone, though we can answer questions.
  279.  
  280.          Disks in the PsL are updated  monthly,  so if you did not get
  281.          this disk directly from the PsL, you should be aware that the
  282.          files in this set may no longer be the current versions. Also,
  283.          if you got this disk from another vendor and are having prob-
  284.          lems,  be aware that  some files may have become corrupted or
  285.          lost by that vendor. Get a current, working disk from PsL.
  286.  
  287.          For a copy of the latest monthly software library newsletter
  288.          and a list of the 3,000+ disks in the library, call or write
  289.  
  290.                            Public (software) Library
  291.                                P.O.Box 35705 - F
  292.                             Houston, TX 77235-5705
  293.  
  294.                                 1-800-2424-PSL
  295.                              MC/Visa/AmEx/Discover
  296.  
  297.                           Outside of U.S. or in Texas
  298.                           or for general information,
  299.                               Call 1-713-524-6394
  300.  
  301.                           PsL also has an outstanding
  302.                           catalog for the Macintosh.
  303.  
  304.